﻿using NLog.Config;
using NLog;
using PortCommunicate.LogEntries;
using System.Configuration;
using System.Data;
using System.Windows;

namespace PortCommunicate
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // 注册自定义NLog目标（替代旧的RegisterCustomObjectCreator方法）
            //var config = new LoggingConfiguration();
            //config.AddTarget("WpfLogTarget", new WpfLogTarget());
            //LogManager.Configuration = config;
        }
        protected override void OnExit(ExitEventArgs e)
        {
            LogManager.Shutdown(); // 清理NLog资源
            base.OnExit(e);
        }
    }

}
